// Copyright 2022 a.o.smith ALL Rights Reserved
package com.liuxinlong.enums;

/**
 * 消息推送状态类型枚举
 *
 * @author liuxinlong@hotwater.com.cn
 * @version 1.0.0
 * @since 2023-02-06
 */
public enum MessagePushRecordStatusEnum {
    ALL_SUCCESS(0, "全部成功"),
    PART_SUCCESS(1, "部分成功"),
    ALL_FAILED(2, "全部失败"),
    RECALLED(3, "已撤回");

    private int value;

    private String name;

    MessagePushRecordStatusEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static String getNameByValue(int value) {
        MessagePushRecordStatusEnum arrObj[] = MessagePushRecordStatusEnum.values();
        for (MessagePushRecordStatusEnum obj : arrObj) {
            if (value == obj.getValue()) {
                return obj.getName();
            }
        }
        return "其他";
    }
}
